﻿@{
    ViewBag.Title = "Blog";
}
@using DirigoEdge.Utils
@model DirigoEdge.Models.ViewModels.BlogHomeViewModel

@* Breadcrumbs *@
<div class="breadcrumbsContainer row">
    <div class="twelve columns">
        <ul class="breadcrumbs">
            <li>
                <a href="/">
                    <span>Home</span>
                </a>
            </li>
            <li class="current">
                <a href="/blog/">
                    <span>Blog Home</span>
                </a>
            </li>
        </ul>
    </div>
</div>

<div class="row">
    <div class="twelve columns">
        @{
            var blogTitle = @Model.BlogTitle ?? "Blog";
        }
        <h2>@blogTitle</h2>
    </div>
</div>

<div class="row">

    <div class="nine columns blogListing">
        @{
            // Renders the blog article tags
            @Html.Partial("/Views/Shared/Partials/BlogArticlePartial.cshtml", Model.BlogRoll)
            
            <a id="LoadMoreBlogs" href="javascript:void(0);" value="Load More" class="secondary loadMore button" data-lastblog="@Model.BlogRoll.LastOrDefault().BlogId" data-blogCount="@Model.MaxBlogCount">Load More</a>
        }
    </div>

    <aside class="three columns blogPanels">
        
        @* Categories *@
        @Html.Partial("~/Views/Shared/Partials/CategoriesListingPartial.cshtml", Model.BlogCats)
        
        @* Latest Blogs / Popular *@
        @Html.Partial("~/Views/Shared/Partials/PopularBlogsPartial.cshtml", new DirigoEdge.Models.ViewModels.BlogPopularViewModel())
        
        @* Archive *@
        @Html.Partial("~/Views/Shared/Partials/BlogArchivePartial.cshtml", new DirigoEdge.Models.ViewModels.BlogArchiveViewModel())
        
        <div class="panel">
            <h5>Featured</h5>
            @{
                if (Model.FeaturedBlog != null)
                {
                    <p>@Html.Raw(Model.FeaturedBlog.ShortDesc)</p>
                    <a href="/blog/@Model.FeaturedBlog.PermaLink/">Read More →</a>
                }
                else
                {
                    <p>There are currently no featured blogs to display.</p>
                }
            }
        </div>

    </aside>

</div>